<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>测试endsWith</title>
</head>
<body>
<script type="text/javascript">
    let kk="asdfas.py"
    alert(kk.endsWith(".py"))
    let i=kk.lastIndexOf(".")
    alert(kk.substring(0,i))
    alert(kk.substring(i))
</script>
</body>
</html>